package com.example.util.bean;

import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author 贾明祯
 * @ClassName SerialEntity
 * @Date 2020/12/29 8:42
 * @Introduce
 */
public class SerialEntity {
    public static void main(String[] args) {
        SimpleDateFormat df1 = new SimpleDateFormat("YYYY-MM-dd");
        SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd");

        Calendar c = Calendar.getInstance();

        // 2020年12月26日周六
        c.set(Calendar.DATE, 26);
        System.out.println("YYYY-MM-dd = " + df1.format(c.getTime()));
        System.out.println("yyyy-MM-dd = " + df2.format(c.getTime()));

        // 分割线
        System.out.println("========================");

        // 当前
        Date date = new Date();
        System.out.println("YYYY-MM-dd = " + df1.format(date));
        System.out.println("yyyy-MM-dd = " + df2.format(date));
    }
}
